package bean;

import java.sql.Connection;
import java.sql.DriverManager;

public class MyOracle {
	Connection conn;
	
	
	public MyOracle(){
		String driver = "oracle.jdbc.driver.OracleDriver";
		String url = "jdbc:oracle:thin:@127.0.0.1:1521:xe";
		String id = "hr";
		String pw = "hr";
		
		try{
			Class.forName(driver);
			System.out.println("드라이버가 로딩 되었습니다.");
			
			conn = DriverManager.getConnection(url, id, pw);
			System.out.println("Connection이 생성 되었습니다.");
			
			
		}catch(Exception e){
			e.printStackTrace();
		}
		
		
	}

	public Connection getConn() {
		return conn;
	}

	public static void main(String[] args) {
		MyOracle me =new  MyOracle();
	}

}
